#include <iostream>
#include <string>

using namespace std;

class Complex
{
private:
    double real;//实部
    double imag;//虚部
public:
    Complex(/* args */) : real(0) , imag(0)
    {

    }
    Complex(double real , double imag)
        : real(real) , imag(imag)
    {

    }
    //析构
    ~Complex()
    {}
public:
    void show()
    {
        cout << "实部" << real << "虚部" << imag << endl;
    }
public:
    //递增 递减 运算符
    //前置++
    //递增符重载结果 = operator++( void )ew L + R
    //前置++
    Complex & operator++(void)
    {
        ++this->imag;
        ++this->real;
        return *this;
    }
    //后缀++
    Complex operator++(int)
    {
        Complex temp = *this;
        ++this->imag;
        ++this->real;
        return temp;
    }


    //前缀-- 全局 operator#(类名 &)
    friend Complex operator--(Complex &L);
    //后缀-- 全局
    friend Complex const operator--(Complex &L,int);

};

//前缀--
Complex operator--(Complex &L)
{
    --L.imag;
    --L.real;
    return L;
}

//后缀--
Complex const operator--(Complex &L,int)
{
    Complex temp = L;
    --L.imag;
    --L.real;
    return temp;
}


int main(int argc, char const *argv[])
{
    Complex F1(10,10);
    Complex F2;

    //前置++
    F2 = F1++;
    F1.show();
    F2.show();

    //前缀--
    F2 = --F1;
    F1.show();
    F2.show();
    
    return 0;
}
